<?php
	class mloai extends connect_db{
		protected $_loai;
		
		public function setloai($loai){
			$this->_loai = $loai;
		}
		public function getloai(){
			return $this->_loai;
		}
		
		public function __construct(){
			$this->connect();
		}
		public function listloai(){
			$sql = "select * from loaixe";
			$this->query($sql);
			if($this->num_rows() == 0){
				return false;
			}else{
				while ($row = $this->fetch()){
					$data[] = $row;
				}
				return $data;
			}
		}
		public function add(){
			$sql = "insert into loaixe(tenloai) values('".$this->getloai()."')";
			$this->query($sql);
		}
	}
?>